package com.java.demo.service;

import com.java.demo.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2023-07-22
 * Time: 9:31
 */
@Service
public class UserService2 {
    //属性注入获取
    //@Autowired
    //@Qualifier("student1")
    @Resource(name = "student1")
    private  Student student;

    public void sayHi(){
        System.out.println(student.toString());
    }
}
